@extends("/paging_template",minWidth=1000)
@import com.mgfireworks.mgplatform.mgadmin.constants.*
@import com.mgfireworks.mgplatform.mgadmin.product.model.Product
@args List<Product> productList
<div id="datatable-responsive_wrapper" class="dataTables_wrapper dt-bootstrap no-footer">
   		<div class="x_panel">
   			<div class="x_title">
              	<h2>产品列表</h2>
           		<ul class="nav navbar-right panel_toolbox">
               		<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
           		</ul>
              <div class="clearfix"></div>
            </div>
            <div class="x_content" style="display: block;">
	           	<div class="row form-horizontal">
	           		<div class="col-sm-4 form-group">
                        <label class="control-label col-sm-3">产品编号</label>
                        <div class="col-sm-9">
                          <input type="text" class="form-control" name="productId" value="@val("productId")" placeholder="产品编号">
                        </div>
                    </div>
	           		<div class="col-sm-4 form-group">
                        <label class="control-label col-sm-3">产品名</label>
                        <div class="col-sm-9">
                          <input type="text" class="form-control" name="productName" value="@val("productName")" placeholder="产品名">
                        </div>
                    </div>
	           		<div class="col-sm-4 form-group">
                        <label class="control-label col-sm-3">类别</label>
                        <div class="col-sm-9">
                          <input type="text" class="form-control" name="cateId" value="@val("cateId")" placeholder="类别">
                        </div>
                    </div>
	           		<div class="col-sm-4 form-group">
                        <label class="control-label col-sm-3">品牌</label>
                        <div class="col-sm-9">
                          <input type="text" class="form-control" name="bandId" value="@val("bandId")" placeholder="品牌">
                        </div>
                    </div>
	           		<div class="col-sm-4 form-group">
                        <label class="control-label col-sm-3">销售级别</label>
                        <div class="col-sm-9">
                          <input type="text" class="form-control" name="sellLevel" value="@val("sellLevel")" placeholder="销售级别">
                        </div>
                    </div>
	           		<div class="col-sm-4 form-group">
                        <label class="control-label col-sm-3">是否推荐</label>
                        <div class="col-sm-9">
                          <select class="form-control" name="recommend" value="@val("recommend")">
                          	<option value="">请选择</option>
                          	<option value="1">推荐</option>
                          	<option value="0">未推荐</option>
                          </select>
                        </div>
                    </div>
				</div>
	            <div id="div_list_toolbar" class="btn-group">
	            	<button type="submit" class="btn btn-primary btn-lg">查询</button>
			    	<a href="@url("add.html")" class="btn btn-info btn-lg" type="button"><i class="fa fa-plus"></i>添加</a>
			    	<a href="@url("edit.html?productId={0}")" class="btn btn-info btn-lg" type="button"><i class="fa fa-pencil"></i>修改</a>
			    	<a href="@url("del.json?productId={0}")" class="btn btn-default btn-lg" type="button"><i class="fa fa-times"></i>删除</a>
		     	</div>
	            <div class="clearfix"></div>
         	</div>
       </div>

	<div class="row">
		<div class="col-sm-12">
			<table id="datatable" class="table table-striped table-bordered dataTable no-footer" role="grid" aria-describedby="datatable_info">
			  <thead>
			    <tr role="row">
			    	<th class="td_row_id">
					</th>
				    <th>产品编号</th>
				    <th>产品名</th>
				    <th>类别</th>
				    <th>品牌</th>
				    <th>主图片</th>
				    <th>销售级别</th>
				    <th>是否推荐</th>
				    <th>添加时间</th>
				    <th>更新时间</th>
			    </tr>
			  </thead>
			  <tbody>
			  @if(productList){
			  @{int i=0;}
			  @for(Product p : productList){
			   <tr role="row" class="@(i%2==0?"odd":"event")">
			   @{i++;}
			   	  <td class="td_row_id">
				   	  <div class="checkbox">
                        <label>
                          <div class="iradio_flat-green" style="position: relative;"><input type="checkbox" class="flat" name="__recordId" value="@p.getProductId()" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);"></ins></div>
                        </label>
                      </div>
			   	  </td>
				  <td>@p.getProductId()</td>
				  <td>@p.getProductName()</td>
				  <td>@p.getCategoryName()</td>
				  <td>@p.getBandName()</td>
				  <td><img class="product-list-img" src="@p.getMainImg()"/></td>
				  <td>@p.getSellLevelName()</td>
				  <td>@BooleanEnum.valueOf(p.getRecommend())</td>
				  <td>@p.getAddTime()</td>
				  <td>@p.getUpdateTime()</td>
			    </tr>
			   }
			 }else{
			   <tr role="row">
			      <td colspan="10">暂无数据<i class="fa fa-exclamation-circle"></i></td>
			   </tr>
			 }
			    </tbody>
			</table>	
		</div>
	</div>
	
</div>